#![no_std]
#![no_main]

use esp_alloc::*;
use esp_backtrace as _;
use esp_hal::{delay::Delay, main};
use esp_println::println;
#[main]
fn main() -> ! {
    let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
    let peripherals = esp_hal::init(config);
    let delay = Delay::new();
    esp_println::logger::init_logger_from_env();

    esp_alloc::heap_allocator!(size: 72 * 1024);
    //let large_buffer: Vec<u8, _> = Vec::with_capacity_in(1048576, &PSRAM_ALLOCATOR);

    loop {
        let stats: HeapStats = esp_alloc::HEAP.stats();
        //println!("Hello world!");
        println!("{}", stats);
        delay.delay_millis(1000);
    }
}
